from selenium import webdriver
import time



browser = webdriver.Chrome()

url = "https://www.baidu.com/"
browser.get(url)
browser.implicitly_wait(10)

# browser.find_element_by_id('kw').send_keys('中国')
# browser.find_element_by_id('su').click()
# browser.find_element_by_class_name('s_ipt').send_keys('python')
# browser.find_element_by_name('wd').send_keys('python')
# browser.find_element_by_tag_name('')
# browser.find_element_by_xpath("//input[@id='kw']").send_keys('python')
browser.find_element_by_css_selector('#kw').send_keys('python')
browser.find_element_by_css_selector('#from #kw').send_keys('python')



time.sleep(2)
browser.close()  # 关闭当前页面
browser.quit()   # 退出浏览器